package cn.itcast.solr;

import org.apache.solr.client.solrj.SolrServer;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.impl.HttpSolrServer;
import org.junit.Test;

import java.io.IOException;

public class SolrIndexDeleteTest {
    @Test
    public void testDeleteIndex() throws IOException, SolrServerException {
        SolrServer solrServer=new HttpSolrServer("http://localhost:8080/solr/collection1");
//        solrServer.deleteById("1");
        solrServer.deleteByQuery("title:手机");
        solrServer.commit();
    }
}
